#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stddef.h>

//struct s
//{
//	char a;
//	int b;
//	double c;
//};
//int main()
//{
//	//offsetof
//	printf("%d\n", offsetof(struct s, a));
//	printf("%d\n", offsetof(struct s, b));
//	printf("%d\n", offsetof(struct s, c));
//	return 0;
//

#define OFFSETOF(structname, membername) ((size_t)&(((structname*)0) ->membername))
struct s
{
	char a;
	int b;
	double c;
};
int main()
{
	printf("%d\n", OFFSETOF(struct s, a));
	printf("%d\n", OFFSETOF(struct s, b));
	printf("%d\n", OFFSETOF(struct s, c));
	return 0;
}